package cn.neusoft.service.Impl;
import cn.neusoft.domain.Warehouse;
import cn.neusoft.mapper.WarehouseMapper;
import cn.neusoft.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class WarehouseServiceImpl implements WarehouseService {
    @Autowired
    WarehouseMapper warehouseMapper;

    @Override
    public Warehouse selectById(Long id) {
        return warehouseMapper.selectByPrimaryKey(id);
    }

    @Override
    public int DeleteById(Long id) {
        return warehouseMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int update(Warehouse warehouse) {
        return warehouseMapper.updateByPrimaryKey(warehouse);
    }

    @Override
    public int add(Warehouse warehouse) {
        return warehouseMapper.insert(warehouse);
    }

    @Override
    public List<Warehouse> selectAll() {
        return warehouseMapper.selectAll();
    }
}
